const state = {
    publicUpdateData: null, // 公用页面需要更新的数据对象,使用完需要初始化
    globalData: {}, // 手机导航栏信息
    throttling: true, // 按钮和跳转的节流变量，为true时往下执行
    shareRouteData: {}, // 路由上的参数
    isRefreshType: false, // 刷新数据
    previewData: {}, // 预览数据
    goBackType: false, // 处理是否是从发布动态过去的
    videoFlowList: [], // 首页视频流数据
    squeezeType: null,
    // currentPage: 0, // 视频流页面请求数据的页码
}

const mutations = {
    PUBLIC_UPDATE_DATA (state, publicUpdateData) {
        state.publicUpdateData = publicUpdateData
    },
    GlOBAL_DATA (state, globalData) {
        state.globalData = globalData
    },
    SET_THROTTLING(state, delay){
        state.throttling = false
        setTimeout(() => {
            state.throttling = true // 可以再次执行了
        }, delay);
    },
    SHARE_ROUTE_DATA (state, shareRouteData) {
        state.shareRouteData = shareRouteData
    },
    IS_REFRESH_TYPE (state, isRefreshType) {
        state.isRefreshType = isRefreshType
    },
    PREVIEW_DATA (state, previewData) {
        state.previewData = previewData
    },
    GO_BACK_TYPE (state, goBackType) {
        state.goBackType = goBackType
    },
    VIDEO_FLOW_LIST (state, videoFlowList) {
        state.videoFlowList = videoFlowList
    },
    SQUEEZE_TYPE(state, squeezeType) {
        state.squeezeType = squeezeType
    }
    // CURRENT_PAGE (state, currentPage) {
    //     state.currentPage = currentPage
    // },
}

export default {
    state,
    mutations
}